package com.ikaros.controller.admin;

import com.ikaros.model.entity.SysMenu;
import com.ikaros.model.query.BaseQuery;
import com.ikaros.service.admin.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Ikaros on 2017/9/29.
 */
@RestController
@RequestMapping("admin/menu")
public class MenuController extends AbstractController{
    @Autowired
    private SysMenuService sysMenuService;
    @RequestMapping(value = "list",method = RequestMethod.GET)
    public ModelAndView menuList(BaseQuery query,Map<String, Object> map) {
        List<SysMenu> menuList=sysMenuService.queryList(map);
        ModelAndView view=new ModelAndView("admin/menuList");
        view.addObject("list",menuList);
        return view;
    }
}
